<template>
    <div>
        user模块：
        <p>姓名：{{ name }}</p>
        <p>性别：{{ sex }}</p>
        <p>年龄：{{ age }}</p>
        <button @click="changeAge">增加按钮</button>
        <button @click="changeName">改变姓名</button>
    </div>
</template>
<script setup>  
import { useStore } from '../store/user.js'   
import { storeToRefs } from 'pinia'
const store = useStore()
const { name,sex,age } = storeToRefs(store)
const changeAge = () => {
    store.changeAge()
}
const changeName = () => {
    store.changeName()
}
</script>